package com.kluniv.tank;

import java.awt.image.BufferedImage;
import java.io.IOException;

import javax.imageio.ImageIO;

public class ResourceMgr {
	protected static BufferedImage goodTankL;
	protected static BufferedImage goodTankU;
	protected static BufferedImage goodTankR;
	protected static BufferedImage goodTankD;

	protected static BufferedImage badTankL;
	protected static BufferedImage badTankU;
	protected static BufferedImage badTankR;
	protected static BufferedImage badTankD;

	protected static BufferedImage tankL;
	protected static BufferedImage tankU;
	protected static BufferedImage tankR;
	protected static BufferedImage tankD;

	protected static BufferedImage bulletL;
	protected static BufferedImage bulletU;
	protected static BufferedImage bulletR;
	protected static BufferedImage bulletD;

	protected static BufferedImage[] explodes = new BufferedImage[16];

	static {
		try {
			goodTankU = ImageIO.read(ResourceMgr.class.getClassLoader().getResourceAsStream("images/GoodTank1.png"));
			goodTankL = ImageUtil.rotateImage(goodTankU, -90);
			goodTankR = ImageUtil.rotateImage(goodTankU, 90);
			goodTankD = ImageUtil.rotateImage(goodTankU, 180);
			
			badTankU = ImageIO.read(ResourceMgr.class.getClassLoader().getResourceAsStream("images/BadTank1.png"));
			badTankL = ImageUtil.rotateImage(badTankU, -90);
			badTankR = ImageUtil.rotateImage(badTankU, 90);
			badTankD = ImageUtil.rotateImage(badTankU, 180);

			bulletU = ImageIO.read(ResourceMgr.class.getClassLoader().getResourceAsStream("images/bulletU.png"));
			bulletL = ImageUtil.rotateImage(bulletU, -90);
			bulletR = ImageUtil.rotateImage(bulletU, 90);
			bulletD = ImageUtil.rotateImage(bulletU, 180);

			for (int i = 0; i < 16; i++)
				explodes[i] = ImageIO
						.read(ResourceMgr.class.getClassLoader().getResourceAsStream("images/e" + (i + 1) + ".gif"));

		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
